package com.slz3.business.module.configManagement.conZone.steward;

import com.slz3.business.module.configManagement.conZone.domain.ConZone;
import com.slz3.business.module.configManagement.conZone.domain.ConZoneCondition;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

public class ConZoneResponse {

    public static Mono<ServerResponse> add(ServerRequest req) {
        return req.bodyToMono(ConZone.class).flatMap(conZone ->
                ConZoneResController.add(req, conZone)
        );
    }

    public static Mono<ServerResponse> delete(ServerRequest req) {
        return req.bodyToMono(ConZoneCondition.class).flatMap(conZoneCondition ->
                ConZoneResController.delete(req, conZoneCondition)
        );
    }

    public static Mono<ServerResponse> modify(ServerRequest req) {
        return req.bodyToMono(ConZone.class).flatMap(conZone ->
                ConZoneResController.modify(req, conZone)
        );
    }


    public static Mono<ServerResponse> list(ServerRequest req) {
        return ConZoneResController.list(req);
    }

    public static Mono<ServerResponse> info(ServerRequest req) {
        return ConZoneResController.info(req);
    }

    public static Mono<ServerResponse> choice(ServerRequest req) {
        return ConZoneResController.choice(req);
    }

    public static Mono<ServerResponse> auditSubmit(ServerRequest req) {
        return req.bodyToMono(ConZoneCondition.class).flatMap(conZoneCondition ->
                ConZoneResController.auditSubmit(req, conZoneCondition)
        );
    }

    public static Mono<ServerResponse> audit(ServerRequest req) {
        return req.bodyToMono(ConZoneCondition.class).flatMap(conZoneCondition ->
                ConZoneResController.audit(req, conZoneCondition)
        );
    }

    public static Mono<ServerResponse> auditReject(ServerRequest req) {
        return req.bodyToMono(ConZoneCondition.class).flatMap(conZoneCondition ->
                ConZoneResController.auditReject(req, conZoneCondition)
        );
    }

    public static Mono<ServerResponse> usingEnable(ServerRequest req) {
        return req.bodyToMono(ConZoneCondition.class).flatMap(conZoneCondition ->
                ConZoneResController.usingEnable(req, conZoneCondition)
        );
    }

    public static Mono<ServerResponse> usingDisable(ServerRequest req) {
        return req.bodyToMono(ConZoneCondition.class).flatMap(conZoneCondition ->
                ConZoneResController.usingDisable(req, conZoneCondition)
        );
    }   

}
